﻿using System;

namespace BSharp.Compiler.Emit
{
	public class LoadLocal : IntermediateInstruction
	{
		public readonly int Index;
		public readonly int Register;

		public LoadLocal (int register, int index)
		{
			Register = register;
			Index = index;
		}

		public override void Visit (IntermediateCompiler compiler)
		{
			compiler.Compile (this);
		}

		public override string ToString ()
		{
			return String.Format ("LOAD_LOCAL r{0}, l{1}", Register, Index);
		}
	}
}

